package cn.com.self.apis.portal.entity;

import cn.com.self.apis.files.entity.Files;
import cn.com.selfsoft.smartcity.commons.entity.AbstractEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;
import java.util.List;

/**
 * 首页轮播图信息
 * @author CRL
 * @date 2021/1/9 21:28
 */
@TableName("u_advertisement")
@Data
public class AdvertisementEntity extends AbstractEntity {

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "推荐开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp startTime;

    @ApiModelProperty(value = "推荐结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp endTime;

    @ApiModelProperty(value = "推荐排序")
    private String sort;

    @ApiModelProperty(value = "图片地址(附件)")
    private String url;

    @ApiModelProperty(value = "优先级:1高 2中 3低")
    private String aLevel;

    @ApiModelProperty(value = "跳转路径")
    private String goUrl;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @CreatedDate
    private Timestamp createTime;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @LastModifiedDate
    private Timestamp updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "图片附件")
    private List<Files> files;

}
